package org.huangrui.spark.scala.sql

import org.apache.spark.sql.SparkSession

/**
 * @Author hr
 * @Create 2024-10-20 9:58 
 */
object SparkSQL03_SQL {
  def main(args: Array[String]): Unit = {
    val session = SparkSession.builder().appName("SparkSQL03_SQL").master("local[2]").getOrCreate()

    session.read.json("data/user.json").createOrReplaceTempView("user")
    session.sql("select * from user").show()


    session.stop()
  }
}
